<template>
	<view class="wrap-avatar-bg" @click.stop="$emit('click')">
		<view
			class="default-avatar bg-img-set"
			:style="'background-image: url(' + $staticImagePath('common/default_avatar.png') + '); width: ' + size + ';height:' + size + ';'"
		>
			<image class="avatar" :src="$getImageURL(src)" />
		</view>
		
		<image class="auth" v-if="auth == 2" :src="$staticImagePath('mine/auth.png')" />
	</view>
</template>

<script>
	export default {
		props: {
			/**
			 * 头像地址
			 */
			src: {
				type: String,
				default: "",
			},
			/**
			 * 身份认证
			 */
			auth: {
				type: String,
				default: ""
			},
			/**
			 * 尺寸
			 */
			size: {
				type: String,
				default: "110rpx",
			}
		},
		methods: {
			/**
			 * 点击事件
			 */
		}
	}
</script>

<style lang="scss" scoped>
	.wrap-avatar-bg {
		overflow: hidden;
		position: relative;
		
		.default-avatar {
			border-radius: 50%;
			overflow: hidden;
			
			.avatar {
				width: 100%;
				height: 100%;
				border-radius: 50%;
				overflow: hidden;
			}
		}
		
		.auth {
			position: absolute;
			right: 0rpx;
			bottom: 0rpx;
			width: 30rpx;
			height: 36rpx;
		}
	}
</style>